import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/axios'
import 'element-ui/lib/theme-chalk/index.css';
import ElementUi from 'element-ui'
import locale from 'element-ui/lib/locale/lang/zh-CN'
import tools from './utils/tools'
// import "./assets/css/style-starter.css"
import "./assets/css/base.css"
import moment from "moment";
// 全局配置
import './js/config.js';
import './js/common.js';
import FileSaver from 'file-saver'
import XLSX from 'xlsx'
Vue.prototype.$FileSaver = FileSaver; //设置全局
Vue.prototype.$XLSX = XLSX; //设置全局

moment.locale("zh-cn")
var axios = require('axios')
Vue.use(ElementUi, {locale})
Vue.config.productionTip = false
Vue.prototype.$tools = tools
Vue.filter('formatDateBirth', function (value) {
  if(value===null){
    return ""
  }
  return moment(value).format('YYYY-MM-DD')
})
Vue.filter('formatDateMonth', function (value) {
  if(value===null){
    return ""
  }
  return moment(value).format('YYYY年MM月')
})
Vue.filter('formatDateMonthDay', function (value) {
  if(value===null){
    return ""
  }
  return moment(value).format('YYYY-MM-DD')
})
// 定义全局时间戳过滤器
Vue.filter('formatDate', function (value) {
  if(value===null){
    return ""
  }
  return moment(value).format('YYYY-MM-DD HH:mm:ss')
})

Vue.filter('formatDateYX', function (value) {
  if(value===null||value===""){
    return "长期有效"
  }
  return moment(value).format('YYYY-MM-DD HH:mm:ss')
})
Vue.filter('formatDateDDDD', function (value) {
  if(value===null){
    return ""
  }
  return moment(value).format('dddd')
})
Vue.filter('formatDateSeconds', function (value) {
  if(value===null){
    return ""
  }
  return moment.utc(value * 1000).format('mm:ss')
})
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
